package sort

type SortUint64Model struct {
	list []uint64
	desc bool
}

//
func newSortUint64(list []uint64, desc bool) SortUint64Model {
	return SortUint64Model{
		list: list,
	}
}

//实现自带排序接口
func (this SortUint64Model) Len() int {
	return len(this.list)
}

//实现自带排序接口
func (this SortUint64Model) Less(i, j int) bool {
	b := this.list[i] < this.list[j]
	if this.desc {
		b = !b
	}
	return b
}

//实现自带排序接口
func (this SortUint64Model) Swap(i, j int) {
	this.list[i], this.list[j] = this.list[j], this.list[i]
}
